<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:body>

	<ui:composition template="../template/template.xhtml">

		<ui:define name="content">
			<h:form>
				<p:panel header="personal data">
					<p:accordionPanel>
						<p:tab title="general">
							<table>
								<tr>
									<td><h:outputLabel for="email" value="email*" /></td>
									<td><p:inputText id="email"
											value="#{personalDataJSF.personalData.email}" required="true"
											label="email" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="phoneNumber" value="phone*" /></td>
									<td><p:inputText id="phoneNumber"
											value="#{personalDataJSF.personalData.phone_number}"
											required="true" label="phoneNumber" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="forename" value="forename*" /></td>
									<td><p:inputText id="forename"
											value="#{personalDataJSF.personalData.forename}"
											required="true" label="forename" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="sirname" value="sirname*" /></td>
									<td><p:inputText id="sirname"
											value="#{personalDataJSF.personalData.sirname}"
											required="true" label="sirname" /></td>
								</tr>
							</table>
							<p:commandButton styleClass="bottomButton"
								action="#{personalDataJSF.updatePersonalData}"
								value="change personal data" />
						</p:tab>
						<p:tab title="location">
							<table>
								<tr>
									<td><h:outputLabel for="country" value="country*" /></td>
									<td><p:inputText id="country"
											value="#{personalDataJSF.location.country}" required="true"
											label="country" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="city" value="city*" /></td>
									<td><p:inputText id="city"
											value="#{personalDataJSF.location.city}" required="true"
											label="city" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="zip" value="zip*" /></td>
									<td><p:inputText id="zip"
											value="#{personalDataJSF.location.zip}" required="true"
											label="zip" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="street" value="street*" /></td>
									<td><p:inputText id="street"
											value="#{personalDataJSF.location.street}" required="true"
											label="street" /></td>
								</tr>
							</table>
							<p:commandButton styleClass="bottomButton"
								action="#{personalDataJSF.updatePersonalData}"
								value="change location" />
						</p:tab>
						<p:tab title="password">
							<table>
								<tr>
									<td><h:outputLabel for="oldPassword" value="old password*" /></td>
									<td><p:password id="oldPassword"
											value="#{personalDataJSF.oldPassword}" label="oldPassword" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="newPassword" value="new password*" /></td>
									<td><p:password id="newPassword"
											value="#{personalDataJSF.newPassword}"
											feedback="true" match="confirmPassword" label="newPassword" /></td>
								</tr>
								<tr>
									<td><h:outputLabel for="confirmPassword"
											value="confirm new password*" /></td>
									<td><p:password id="confirmPassword"
											value="#{personalDataJSF.confirmPassword}"
											label="confirmPassword" /></td>
								</tr>
							</table>
							<p:commandButton styleClass="bottomButton"
								action="#{personalDataJSF.updatePassword}"
								value="change password" />
						</p:tab>
					</p:accordionPanel>
				</p:panel>
			</h:form>
		</ui:define>

	</ui:composition>

</h:body>

</html>